#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s1;
    string s2;
    cin >> s1 >> s2;

    int n = s1.size();
    int ret = 0;
    for (int i = 0; i < n; ++i)
    {
        if (s1[i] == '.' && s2[i] == '.')
            continue;
        if (s1[i] == '#' && s2[i] == '.' && i + 1 < n)
        {
            s1[i + 1] = '#';
            ret++;
        }
        else if (s2[i] == '#' && s1[i] == '.' && i + 1 < n)
        {
            s2[i + 1] = '#';
            ret++;
        }
    }

    cout << ret;


    return 0;
}